<template>
	<view>
		<view class="nabbar" :style="{'height': statusBarHeight + barHeight + 'px'}">
			<!-- //手机状态栏 -->
			<view class="status-bar" :style="{'height': statusBarHeight + 'px'}"></view>
			<!-- //导航栏 -->
			<view class="nabbar-box" :style="{ 'top': statusBarHeight+ 'px', 'heigth': barHeight + 'px' }">
				<view class="nabbar-cont">
					<view @click="toBack()" style="position: absolute;left: 20rpx;">
						<uni-icons type="left" size="20" color="#fff"></uni-icons>
					</view>
					<view style="font-size: 30rpx;">消息通知、视频会议</view>
				</view>
			</view>
		</view>
		<view class="main">
			<view class="item flex align" @click="toUrl(1)">
				<image src="/static/images/icon6.png"></image>
				消息通知
			</view>
			<view class="item flex align" @click="toUrl(2)">
				<image src="/static/images/icon7.png"></image>视频会议
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusBarHeight: 20,
				barHeight: 44,
				barWidth: null,
			}
		},
		methods: {
			toBack() {
				uni.navigateBack()
			},
			toUrl(n) {
				if (n == 2) {
					uni.navigateToMiniProgram({
						appId: 'wx33fd6cdc62520063',
						path: '',
						success(res) {}
					});
				} else {
					uni.navigateTo({
						url: '/pages/message/message'
					})
				}

			},

		},
		onLoad() {
			let that = this;
			//通过uni自带api获取手机系统信息
			uni.getSystemInfo({
				success: function(res) {
					// console.log(res)
					that.statusBarHeight = res.statusBarHeight; //手机状态栏高度
					let isiOS = res.system.indexOf('iOS') > -1; //是否为iOS系统
					that.barHeight = !isiOS ? 48 : 44; //导航栏高度，iOS：48，Android：44
					that.barWidth = res.windowWidth - 87; //nabbar可操作宽度 = 屏幕宽度 - 小程序右上角的胶囊宽度（87）
				}
			})

		}
	}
</script>

<style lang="scss" scoped>
	.bg {
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		left: 0;
	}

	.main {
		position: relative;
		padding-top: 280rpx;
	}
	.nabbar{
		background: #FF9008;
	}

	.item {
		background: white;
		text-align: center;
		border-radius: 8rpx;
		color: 38rpx;
		font-size: 38rpx;
		margin: 0 auto 180rpx;
		padding: 37rpx 65rpx;
		border-radius: 12rpx;
		box-shadow: 1rpx 1rpx 2rpx 1rpx gainsboro;
		width: fit-content;

		image {
			width: 115rpx;
			height: 89rpx;
			margin-right: 92rpx;
		}

		text {
			display: block;
			font-size: 24rpx;
			color: #532f02;
			margin-top: 10rpx;
		}
	}
</style>